// 导入数据库API
const db = require("../../config/db");

module.exports = {
    get_goods_detail(gid) {
        return new Promise((resolve, reject) => {
            let detail_sql = `select * from db_goods  where gid=${gid}`;
            db.query(detail_sql, (err, result) => {
                if (err) {
                    reject({
                        code: -1,
                        mag: "查找不到商品信息",
                    });
                } else {
                    resolve(result);
                }
            });
        });
    },
};
